package com.rc.saas.mini.service.tenant;

import com.rc.saas.mini.mapper.tenant.TenantTransferMapper;
import com.rc.saas.mini.model.tenant.TenantTransfer;
import com.rc.saas.mini.model.tenant.TenantTransferExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TenantTransferServiceImpl implements TenantTransferService {
    @Autowired
    private TenantTransferMapper tenantTransferMapper;

    @Override
    public TenantTransferMapper getMapper() {
        return tenantTransferMapper;
    }

    @Override
    public TenantTransfer selectByTenantCode(String tenantCode) {
        TenantTransferExample example = new TenantTransferExample();
        example.createCriteria().andTenantCodeEqualTo(tenantCode);
        return tenantTransferMapper.selectByExample(example).stream().findFirst().orElseGet(() -> null);

    }
}
